package com.hs.communication.common.fallback.handlers;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;

import static com.hs.communication.common.constant.Code.*;

@Component
public class InverterHandler {
    public Map<Byte, BiConsumer<String, byte[]>> map = new HashMap<>();

    @PostConstruct
    public void init() {
        map.put(LOGIN, this::handle0x01);
        map.put(HEARTBEAT, this::handle0x03);
        map.put(REAL_DATA, this::handle0x11);
    }

    public void handle0x01(String connection, byte[] bytes) {

    }

    public void handle0x03(String connection, byte[] bytes) {

    }

    public void handle0x11(String connection, byte[] bytes) {

    }
}
